import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralConferenceInfo = (params) => {
  params.head.transCode = 'queryGeneralConferenceInfo';
  return request({
    url: '/general/generalConferenceInfo/queryGeneralConferenceInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralConferenceInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralConferenceInfoListPage';
  return request({
    url: '/general/generalConferenceInfo/queryGeneralConferenceInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralConferenceInfo = (params) => {
  params.head.transCode = 'saveGeneralConferenceInfo';
  return request({
    url: '/general/generalConferenceInfo/saveGeneralConferenceInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralConferenceInfoList = (params) => {
  params.head.transCode = 'saveGeneralConferenceInfoList';
  return request({
    url: '/general/generalConferenceInfo/saveGeneralConferenceInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralConferenceInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralConferenceInfo';
  return request({
    url: '/general/generalConferenceInfo/saveOrUpdateGeneralConferenceInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralConferenceInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralConferenceInfoList';
  return request({
    url: '/general/generalConferenceInfo/saveOrUpdateGeneralConferenceInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralConferenceInfo = (params) => {
  params.head.transCode = 'updateGeneralConferenceInfo';
  return request({
    url: '/general/generalConferenceInfo/updateGeneralConferenceInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralConferenceInfo = (params) => {
  params.head.transCode = 'deleteGeneralConferenceInfo';
  return request({
    url: '/general/generalConferenceInfo/deleteGeneralConferenceInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralConferenceInfoList = (params) => {
  params.head.transCode = 'deleteGeneralConferenceInfoList';
  return request({
    url: '/general/generalConferenceInfo/deleteGeneralConferenceInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralConferenceInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalConferenceInfo/excelDownload/exportGeneralConferenceInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
//查询时间段内的会议信息
export const queryConferenceDuration = (params) => {
  params.head.transCode = 'queryConferenceDuration';
  return request({
    url: '/general/generalConferenceInfo/queryConferenceDuration',
    method: 'post',
    data: params
  })
}

//创建腾讯会议
export const createTencentMeeting = (params) => {
  params.head.transCode = 'createTencentMeeting';
  return request({
    url: '/general/generalConferenceInfo/createTencentMeeting',
    method: 'post',
    data: params
  })
}

//发送微信通知
export const sendNotice = (params) => {
  params.head.transCode = 'sendNotice';
  return request({
    url: '/general/generalConferenceInfo/sendNotice',
    method: 'post',
    data: params
  })
}
